A rich text editor is a software application for creating and editing rich text content, e.g., text with various formatting styles such as bold, italics, list items, etc. An online rich-text editor is an interface for editing rich text within a web browser or browser like apps on a client computer (“client”) which present the user with a “what-you-see-is-what-you-get” (WYSIWYG) editing area. Typically, the goal of such editors is to reduce the effort for users trying to express their formatting directly as valid hyper-text markup language (HTML) markup.
The formatting capabilities of current rich text editors are naïve, and their formatting behavior is, sometimes, erratic. For example, the highlighting of text is based on a measurement of the text portion in the graphical user interface (GUI). The editors measure the particular portion of the text to be highlighted, then generate a highlighted portion of the particular measure and then assume the text overlaps with the highlighted portion of the GUI. This method can be inaccurate, e.g., when the GUI is zoomed, the highlighted text splits into multiple lines, as the highlighted portion then does not match with the portion of the text to be highlighted.
The technical capabilities of such editors are limited. Many rich text editors, e.g., “contentEditable,” store a state of the document, e.g., formatting features, with a document object model (DOM) that is used to represent the document. The state of the document cannot be separated from the DOM. The drawback of that is the text editor is dependent on the nature of the browser, and different browsers store the DOM differently. Different browsers can use different HTML tags for different styles. So when the document is saved, the way the document is saved is dependent on the browser. When the document is viewed on different browsers it can be rendered differently and can therefore, be inconsistent across browsers. For example, Google Chrome™ browser from Google of Mountain View, Calif., can represent a paragraph in a different way from Safari® web browser from Apple® of Cupertino, Calif., and in a different way from Firefox® web browser from Mozilla® of Mountain View, Calif.